using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ExplosionPod:Mob {

	MobProjectile projectile;

	protected override void Start() {
		base.Start();
		projectile=GetComponent<MobProjectile>();
	}

	protected override void OnDestroy() {
		base.OnDestroy();
		Projectile.Create(
			ProjectileData.nameToData["Explosion"],
			transform.position,
			Angle.right,
			this,
			x=> {
				x.stat.damage.value=projectile.stat.damage;
				x.stat.size=projectile.stat.size;
			}
		);
		
	}

	protected override void StateIdle() {
		if(stateTime<0.5f) targetVelocity=projectile.velocity;
		else targetVelocity=Vector2.zero;
	}

}
